import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import redis
import time
city_dict={'bj':'beijing','nj':'nanjing','sh':'shanghai','gz':'guangzhou','sz':'shenzhen'}
city=city_dict[sys.argv[1]]
type=sys.argv[2]
key="%s_%s" % (city, type)
print key
rc = redis.Redis(host='101.200.81.152', port=6380,db=8,password='zhugeZHAOFANG1116')
rc.hset('etl_suspend', key, '0')
etl=rc.hget('etl_suspend', key)
rc.hset('compare_suspend', key, '0')
print etl
compare=rc.hget('compare_suspend', key)
print compare
if (etl=='1' or compare=='1'):
    print 'continue failed'
    #time.sleep(15*60)
    sys.exit(1)
else:
    print 'continue succeed'


